Interface Directory

All Superinterfaces:
IPCObject, SimFile
All Known Subinterfaces:
FileSystem
All Known Implementing Classes:
DirectoryImpl, FileSystemImpl

public interface Directory extends SimFile
Information provided by the PKI file:

    \class Directory
    
    \brief Directory is the directory of the file systems for routers and switches.
    
    \example network().getDevice("Router0").getProcess("FileManager").getFileSystem("flash:")
    
Author:
Auto-generated
  • Method Details

    • getFileCount

      int getFileCount()
      Information provided by the PKI file:
      
          \brief Returns the number of files in the file system.
          
          \return int, the number of files in the file system.
          
              
      Returns:
      int Returns a int
    • getFileAt

      SimFile getFileAt(int index)
      Information provided by the PKI file:
      
          \brief Returns the file at the specified index.
          
          \param index, the index of the file of interest.
          
          \return SimFile, the SimFile object at the specified index.
          
              
      Parameters:
      index - Takes in a parameter of index
      Returns:
      SimFile Returns a SimFile
    • getFile

      SimFile getFile(String filename)
      Information provided by the PKI file:
      
          \brief Returns the file with the specified filename.
          
          \param filename, the filename of the file.
          
          \return SimFile, the SimFile object with the associated filename.
          
              
      Parameters:
      filename - Takes in a parameter of filename
      Returns:
      SimFile Returns a SimFile
    • fileExist

      boolean fileExist(String name)
      Information provided by the PKI file:
      
          \brief Returns if a file exist in the file system
          
          \param name, file name
          
          \return bool, true if exists and false if not
          
              
      Parameters:
      name - Takes in a parameter of name
      Returns:
      boolean Returns a boolean
    • getSpaceUsed

      int getSpaceUsed()
      Information provided by the PKI file:
      
          \brief Returns the amount of space used on this file system.
          
          \return int, the amount of space used on this file system.
          
              
      Returns:
      int Returns a int
    • addTextFile

      boolean addTextFile(String name, String content, boolean bCheckPermission)
      Information provided by the PKI file:
      
          \brief Add text file into filesystem
          
          \param name, SimFile name
          
          \param content, file content
          
          \param bCheckPermission, true if write permission needs to be checked and false if otherwise
          
          \return bool, true if the file was added successfully and false if not
          
              
      Parameters:
      name - Takes in a parameter of name
      content - Takes in a parameter of content
      bCheckPermission - Takes in a parameter of bCheckPermission
      Returns:
      boolean Returns a boolean
    • addDirectory

      boolean addDirectory(String name, boolean bCheckPermission)
      Information provided by the PKI file:
      
          \brief Add directory into filesystem
          
          \param name, Directory name
          
          \param bCheckPermission, true if write permission needs to be checked and false if otherwise
          
          \return bool, true if the file was added successfully and false if not
          
              
      Parameters:
      name - Takes in a parameter of name
      bCheckPermission - Takes in a parameter of bCheckPermission
      Returns:
      boolean Returns a boolean
    • addHttpPage

      boolean addHttpPage(String name, String content, boolean bCheckPermission)
      Information provided by the PKI file:
      
          \brief Returns true if the HTTP page was added successfully, false otherwise.
          
          \param name, the name of the HTTP page.
          \param content, the content of the HTTP page.
          \param bCheckPermission, true to check permissions, false to skip.
          
          \return bool, true if the HTTP page was added successfully, false otherwise.
          
              
      Parameters:
      name - Takes in a parameter of name
      content - Takes in a parameter of content
      bCheckPermission - Takes in a parameter of bCheckPermission
      Returns:
      boolean Returns a boolean
    • removeFile

      boolean removeFile(String name, boolean bCheckPermission)
      Information provided by the PKI file:
      
          \brief Returns true if the file was removed successfully, false otherwise.
          
          \param name, the name of the file of interest.
          \param bCheckPermission, true to check permissions, false to skip.
          
          \return bool, true if the file was removed successfully, false otherwise.
          
              
      Parameters:
      name - Takes in a parameter of name
      bCheckPermission - Takes in a parameter of bCheckPermission
      Returns:
      boolean Returns a boolean
    • removeAllFiles

      boolean removeAllFiles(boolean bCheckPermission)
      Information provided by the PKI file:
      
          \brief Returns true if all files were removed successfully, false otherwise.
          
          \param bCheckPermission, true to check permissions, false to skip.
          
          \return bool, true if all files were removed successfully, false otherwise.
          
              
      Parameters:
      bCheckPermission - Takes in a parameter of bCheckPermission
      Returns:
      boolean Returns a boolean
    • renameFile

      boolean renameFile(String oldName, String newName, boolean bCheckPermission)
      Information provided by the PKI file:
      
          \brief Returns true if the file was renamed successfully, false otherwise.
          
          \param oldName, the old file name
          
          \param newName, the new file name.
          
          \param bCheckPermission, true to check permissions, false to skip.
          
          \return bool, true if the file was renamed successfully, false otherwise.
          
              
      Parameters:
      oldName - Takes in a parameter of oldName
      newName - Takes in a parameter of newName
      bCheckPermission - Takes in a parameter of bCheckPermission
      Returns:
      boolean Returns a boolean